<!--#include file="../nav/account_top.php" -->
<!--#include file="../nav_menu/account_begin.php" -->
		<div class="main_content_title">重置密码</div>
		<div class="main_content_main">
			<table class="ggtable">
				<tbody>
					<tr>
						<td class="label">原密码：</td>
						<td class="info">
							<input id="old_p" name="old_p" type="password" value="" maxlength="20" class="textBox" /> 
						</td>
					</tr>
					<tr>
						<td class="label">新密码：</td>
						<td class="info">
							<input id="new_p" name="new_p" type="password" value=""  maxlength="20" class="textBox" />
							<span class="gray">	密码由4-20个英文字母或数字组成</span>
						</td>
					</tr>
					<tr>
						<td class="label">确认新密码：</td>
						<td class="info">
							<input id="new_p2" name="new_p2" type="password" value=""  maxlength="20"  class="textBox" />
							<span class="gray">请再次输入新密码</span>
						</td>
					</tr>
					<tr>
						<td class="label">  </td>
						<td class="info">
							<button onclick="fnSave()" class="btn_green">确 定</button> 
							<button onclick="fnReturn()" class="btn_gray">重 置</button> 
						</td>
					</tr> 
				</tbody>	
			</table> 
		</div>
<script type="text/javascript">
$().ready(function(){
	$('#old_p').focus();
 	$('input').bind('keydown',function(e){
		if(e.keyCode==13){
			fnSave();
		}
	});
	fnReturn();
});
function fnSave(){
	if($('#old_p').val() == '' ){
		ymPrompt.alert({message:'请输入原密码',handler:function(){
			$('#old_p').focus();
		}});
		return false;
	}
	if($('#new_p').val() == '' ){
		ymPrompt.alert({message:'请输入新密码',handler:function(){
			$('#new_p').focus();
		}}); 
		return false;
	}
	if($('#new_p').val().length < 4 ){ 
		ymPrompt.alert({message:'请输入至少4位新密码',handler:function(){
			$('#new_p').focus();
		}}); 
		return false;
	}
	if($('#new_p').val() != $('#new_p2').val() ){ 
		ymPrompt.alert({message:'两次输入的新密码必须相同',handler:function(){
			$('#new_p2').focus();
		}}); 
		return false;
	} 
	$('button').attr('disabled','disabled');
	fnLoading();
	$.post(
		'/account/pwd',
		{
			old_p:$('#old_p').val(),
			new_p:$('#new_p').val()
		},
		function(e){
			fnLoadingEnd();
			$('button').attr('disabled','');
			var ok = errorHandler(e); 
			if(ok && ok.success=='1'){
				jumpTo('/account/index');
			}
		}
	);
}
function fnReturn(){
	$('#new_p').val('');
	$('#new_p2').val('');
	$('#old_p').val('').focus();
}
</script>

<!--#include file="../nav_menu/account_end.php" -->
<!--#include file="../nav/account_bottom.php" -->